<template>
  <!-- 旅游资讯首页 -->
  <div>
    <div>
      <TopNav>
        <div class="div-top">旅游资讯</div>
      </TopNav>
      <div class="qwe" v-for="m in menuNav" :key="m.id">
        <router-link :to="{ name: m.name, query: { id: m.id } }">
          <img class="img2" :src="m.img2" alt="" />
        </router-link>
        <div class="qwe-1">
          <div>{{ m.site }}</div>
          <span>{{ m.time }}</span>
        </div>
      </div>
    </div>

    <router-view></router-view>
  </div>
</template>
<script>
import { getTravelnews } from '@/api/travel';

export default {
  data() {
    return {
      menuNav: [],
    };
  },
  created() {
    this.getTravelnews();
  },
  methods: {
    async getTravelnews() {
      const { data } = await getTravelnews();
      this.menuNav = data;
    },
  },
};
</script>

<style lang="scss" scoped>
.div-top {
  font-size: 17px;
  color: #333333;
  letter-spacing: 0;
  text-align: center;
  line-height: 44px;
}
.qwe {
  width: 375px;
  height: 100px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-bottom: 1px solid #ececec;
  .img2 {
    width: 115px;
    height: 75px;
  }
  .qwe-1 {
    width: 230px;
    height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    div {
      font-size: 17px;
      color: #333333;
    }
    span {
      font-size: 12px;
      color: #9da3b4;
    }
  }
}
</style>
